<?php

/**
 * @see Zend_Paginator_Adapter_Interface
 */
require_once 'Zend/Paginator/Adapter/Interface.php';

class Paging_Adapter_Mango implements Zend_Paginator_Adapter_Interface
{

	protected $_cursor = null;

	public function __construct(&$cursor)
	{
		$this -> _cursor = $cursor;
	}

	public function count()
	{
		return $this -> _cursor -> count();
	}

	public function getItems($offset, $perPage)
	{
		return $this -> _cursor -> skip($offset) -> limit($perPage);
	}

}
